package frame

import (
	"gitee.com/git_public/vfaith/builtin/bean"
	"gitee.com/git_public/vfaith/builtin/vault"
	"github.com/jmoiron/sqlx"
)

type IxBaseDao interface {
	DaoInitialize()
}

type IxBaseDaoPO[PO bean.IxBaseEntityPO] interface {
	IxBaseDao
	TotalRecord(param *vault.QueryParam, argsTx ...*sqlx.Tx) (int, error)
	FindList(param *vault.QueryParam, argsTx ...*sqlx.Tx) ([]PO, error)
	FindNumList(param *vault.QueryParam, argsTx ...*sqlx.Tx) (int, []PO, error)
	FindTable(param *vault.QueryParam, argsTx ...*sqlx.Tx) (*vault.TableMap, error)
	FindModel(id int, argsTx ...*sqlx.Tx) (PO, error)
	Create(data PO, argsTx ...*sqlx.Tx) (int64, error)
	Update(data PO, argsTx ...*sqlx.Tx) (int64, error)
	Delete(id int, argsTx ...*sqlx.Tx) (int64, error)
}

type IxBaseDaoVO[VO bean.IxBaseEntityVO] interface {
	IxBaseDao
}

//type IxMutateDao[M bean.IxBaseMapper, PO bean.IxBaseEntityPO] interface {
//	IxBaseDao
//	Create(data PO) (int64, error)
//	Update(data PO) (int64, error)
//	Delete(id int64) (int64, error)
//}
//
//type IxReadDao[M bean.IxBaseMapper, VO bean.IxBaseEntityVO] interface {
//	IxBaseDao
//	SearchCondition(param *vault.QueryParam)
//	TotalRecord(param *vault.QueryParam) (int64, error)
//	FindList(param *vault.QueryParam) ([]VO, error)
//	FindModel(id int64) (VO, error)
//	FindTable(param *vault.QueryParam) (*shape.Table, error)
//}
